package com.darrenchan.leetcode

/**
  * @Desc
  * @Author chenchi03
  * @CreateTime 2019-11-27 01:23
  */
object Q151 {
    def reverseWords(s: String): String = {
        s.trim.split(" +").reverse.mkString(" ")
    }

    def main(args: Array[String]): Unit = {
        println(reverseWords("a good   example"))
        println("a,good,,,example".split(" ").mkString(","))
    }
}
